package com.gitee.wsl.io.dataproxy

open class FloatArrayProxy(val list:FloatArray): DataProxy<Float> {

    override fun iterator() = list.iterator()

    override val size: Int get() = list.size

    override fun get(index: Int): Float = list[index]

    override fun values(): List<Float> = list.toList()

    override fun fill(value: Float, fromIndex: Int, toIndex: Int) {
        list.fill(value,fromIndex, toIndex)
    }

    override fun set(index: Int, value: Float) {
            list[index] = value
        }
}

fun FloatArray.asProxy() = FloatArrayProxy(this)